package com.example.avmanagerweb.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.avmanagerweb.entity.Audiogroupqry;
import com.example.avmanagerweb.result.RLIST;
import com.example.avmanagerweb.service.AudiogroupqryService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xg
 * @since 2023-06-26
 */
@RestController
@RequestMapping("/audiogroupqry")
public class AudiogroupqryController {
    @Autowired
    private AudiogroupqryService audiogroupqryService;

    @GetMapping("getGroupMembers")
    public RLIST getGroupMembers(@RequestParam(value = "groupId")Integer groupId){
        if(groupId == null || groupId == 0){
            return RLIST.error().message("参数异常");
        }
        QueryWrapper<Audiogroupqry> wrapper = new QueryWrapper<>();
        wrapper.eq("audioGroupId",groupId);
        List<Audiogroupqry> list = audiogroupqryService.list(wrapper);
        return RLIST.ok().data("data",list);
    }




}

